load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("scm_server_infra")

rust_library(
    name = "warm_bookmarks_cache",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {"cargo_toml_dir": "."},
    named_deps = ({} if rust_oss.is_oss_build() else {
        "MononokeWarmBookmarkCacheStats_ods3_types": "//eden/mononoke/facebook/ods3_schemas:MononokeWarmBookmarkCacheStats_ods3-rust",
    }),
    test_deps = [
        "fbsource//third-party/rust:maplit",
        "fbsource//third-party/rust:rand_distr",
        "fbsource//third-party/rust:tokio",
        "//common/rust/shed/fbinit:fbinit",
        "//common/rust/shed/fbinit:fbinit-tokio",
        "//eden/mononoke/blobstore:delayblob",
        "//eden/mononoke/blobstore:memblob",
        "//eden/mononoke/common/rust/sql_ext:sql_ext",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/repo_attributes/bonsai_hg_mapping:bonsai_hg_mapping",
        "//eden/mononoke/repo_attributes/commit_graph/commit_graph:commit_graph",
        "//eden/mononoke/repo_attributes/filestore:filestore",
        "//eden/mononoke/repo_attributes/repo_blobstore:repo_blobstore",
        "//eden/mononoke/repo_attributes/repo_event_publisher:repo_event_publisher",
        "//eden/mononoke/repo_factory:test_repo_factory",
        "//eden/mononoke/tests/fixtures:fixtures",
        "//eden/mononoke/tests/utils:tests_utils",
    ],
    deps = ([
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:enum-map",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:itertools",
        "fbsource//third-party/rust:tokio",
        "fbsource//third-party/rust:tracing",
        "//eden/mononoke/repo_attributes/bookmarks:bookmarks",
        "//eden/mononoke/repo_attributes/bookmarks/bookmarks_cache:bookmarks_cache",
        "//eden/mononoke/repo_attributes/bookmarks/bookmarks_types:bookmarks_types",
        "//common/rust/shed/cloned:cloned",
        "//common/rust/shed/facet:facet",
        "//common/rust/shed/futures_stats:futures_stats",
        "//common/rust/shed/justknobs_stub:justknobs",
        "//common/rust/shed/lock_ext:lock_ext",
        "//common/rust/shed/stats:stats",
        "//eden/mononoke/common/futures_watchdog:futures_watchdog",
        "//eden/mononoke/derived_data:basename_suffix_skeleton_manifest_v3",
        "//eden/mononoke/derived_data:blame",
        "//eden/mononoke/derived_data:case_conflict_skeleton_manifest",
        "//eden/mononoke/derived_data:changeset_info",
        "//eden/mononoke/derived_data:deleted_manifest",
        "//eden/mononoke/derived_data:derived_data_manager",
        "//eden/mononoke/derived_data:fastlog",
        "//eden/mononoke/derived_data:fsnodes",
        "//eden/mononoke/derived_data:skeleton_manifest",
        "//eden/mononoke/derived_data:skeleton_manifest_v2",
        "//eden/mononoke/derived_data:unodes",
        "//eden/mononoke/derived_data:inferred_copy_from",
        "//eden/mononoke/derived_data/content_manifest_derivation:content_manifest_derivation",
        "//eden/mononoke/derived_data/filenodes_derivation:filenodes_derivation",
        "//eden/mononoke/derived_data/mercurial_derivation:mercurial_derivation",
        "//eden/mononoke/git/git_types:git_types",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/repo_attributes/phases:phases",
        "//eden/mononoke/repo_attributes/repo_derived_data:repo_derived_data",
        "//eden/mononoke/repo_attributes/repo_event_publisher:repo_event_publisher",
        "//eden/mononoke/repo_attributes/repo_identity:repo_identity",
        "//eden/mononoke/server/context:context",
    ] + ([] if rust_oss.is_oss_build() else [
        "fbsource//third-party/rust:lazy_static",
        "//eden/mononoke/facebook/ods3_schemas:MononokeWarmBookmarkCacheStats_ods3-rs_bindings",
    ])),
)
